import request from '@/utils/request'

//所有的验收记录
export function selectAllAccept() {
  return request({
    url: '/entryWarehouse/accept-inform/selectAll',
    method: 'get'
  })
}

//所有未完成的验收记录
export function selectByNot() {
  return request({
    url: '/entryWarehouse/accept-inform/selectByNot',
    method: 'get'
  })
}

//所有完成的验收记录
export function selectByOk() {
  return request({
    url: '/entryWarehouse/accept-inform/selectByOk',
    method: 'get'
  })
}

//按验收编号查询
export function selectByacId(acceptId) {
  return request({
    url: '/entryWarehouse/accept-inform/selectById',
    method: 'get',
    params: {
      acceptId: acceptId
    }
  })
}

//按验收状态查询
export function selectByStatus(status) {
  return request({
    url: '/entryWarehouse/accept-inform/selectByStatus',
    method: 'get',
    params: {
      status: status
    }
  })
}

//新建验收
export function addAccept(department, provider, place, invoice) {
  return request({
    url: '/entryWarehouse/accept-inform/addAccept',
    method: 'post',
    data: {
      department: department,
      provider: provider,
      place: place,
      invoice: invoice
    }
  })
}

//更改验收(部门名称、供货单位、合同号、到货地点、账单或发票号)
export function editAccept(id, department, acceptId, provider, contract, place, invoice, status, createtime) {
  return request({
    url: '/entryWarehouse/accept-inform/editAccept',
    method: 'post',
    data: {
      id: id,
      department: department,
      acceptId: acceptId,
      provider: provider,
      contract: contract,
      place: place,
      invoice: invoice,
      status: status,
      createtime: createtime
    }
  })
}

//更改验收状态，并入库和更新数量等操作
export function editStatus(id, department, acceptId, provider, contract, place, invoice, status, createtime) {
  return request({
    url: '/entryWarehouse/accept-inform/editStatus',
    method: 'post',
    data: {
      id: id,
      department: department,
      acceptId: acceptId,
      provider: provider,
      contract: contract,
      place: place,
      invoice: invoice,
      status: status,
      createtime: createtime
    }
  })
}

//验收导出
export function exportAccept(acceptId) {
  return request({
    url: '/entryWarehouse/accept-inform/exportAccept',
    method: 'post',
    params: {
      acceptId: acceptId
    },
  })
}

//点收导出
export function exportReceive(acceptId) {
  return request({
    url: '/entryWarehouse/accept-inform/exportReceive',
    method: 'post',
    params: {
      acceptId: acceptId
    }
  })
}

//退料导出
export function exportReturn(acceptId) {
  return request({
    url: '/entryWarehouse/accept-inform/exportReturn',
    method: 'post',
    params: {
      acceptId: acceptId
    }
  })
}
